﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
	CodeBehind="ExamSubjectList.aspx.cs" Inherits="SBACN.WebSite.Admin.MemberService.Education.ExamSubjectList" %>

<%@ Import Namespace="SBACN.WebSite.Common" %>
<%@ Register Src="../../../UC/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<script src="../../../js/plugin/jquery.blockUI.js" type="text/javascript"></script>
	<script type="text/javascript">
		function UpLoadScore(id) {
			$jqy("#<%= HidSubjectID.ClientID %>").val(id);
			$jqy.blockUI({
				message: $jqy("#UploadScore"),
				css: {
					top: '30%',
					left: '35%',
					width: '310px',
					hight: '100px'
				}
			})
		}
		function CancelBtnClick() {
			$jqy.unblockUI();
		}
		function Check() {
			var file = $jqy("#<%= FileUploadScore.ClientID %>").val();
			if (file == "") {
				alert("请选择需要上传的文件！");
				return false;
			}
			var fileArr = file.split("\\");
			var fileTArr = fileArr[fileArr.length - 1].toLowerCase().split(".");
			var filetype = fileTArr[fileTArr.length - 1];
			if (filetype != "xls") {
				alert("上传文件必须为后缀名为xls的Excel文件！");
				return false;
			}
			document.getElementById('form1').appendChild(document.getElementById('UploadScore'));
			$jqy.unblockUI();
			$jqy.blockUI({
				message: '<h5>上传处理中，请稍等...</h5>'
			});
			return true;
		}
		function DeleteSubject(id) {
			document.getElementById("<%= hid_ID.ClientID%>").value = id;
			document.getElementById("<%= btn_Delete.ClientID%>").click();
		}
		function RefreshNewsList() {
			if (document.getElementById("<%= btn_NewsRefresh.ClientID%>")) {
				document.getElementById("<%= btn_NewsRefresh.ClientID%>").click();
			}
		}
	</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-stroke2">
		<tr>
			<td width="40%" class="form-title2">
				培训科目
			</td>
			<td width="10%" class="form-title2">
				报名开始日期
			</td>
			<td width="10%" class="form-title2">
				报名结束日期
			</td>
			<td width="10%" class="form-title2">
				培训时间
			</td>
			<td width="5%" class="form-title2">
				状态
			</td>
			<td width="25%" class="form-title2">
				操作
			</td>
		</tr>
		<asp:Repeater ID="ExamList" runat="server">
			<ItemTemplate>
				<tr>
					<td class="form-body">
						<%# Eval("Subject").ToString().CutTo(32,30) %>
					</td>
					<td class="form-body">
						<%# Convert.ToDateTime(Eval("StartDate")).ToString("yyyy-MM-dd") %>
					</td>
					<td class="form-body">
						<%# Convert.ToDateTime(Eval("EndDate")).ToString("yyyy-MM-dd") %>
					</td>
					<td class="form-body">
						<%# Convert.ToDateTime(Eval("Deadline")).ToString("yyyy-MM-dd") %>
					</td>
					<td class="form-body">
						<%# Convert.ToBoolean( Eval("Status")) ? "<font color='red'>停用</font>":"启用"%>
					</td>
					<td class="form-body">
						<a href="ExamSubjectAdd.aspx?id=<%# Eval("ID") %>&st=<%= SystemType %>" target="_blank">编辑</a>&nbsp;&nbsp;<a id="close" href="javascript:void(0);" onclick="DeleteSubject(<%# Eval("ID") %>)"><%# Convert.ToBoolean(Eval("Status")) ? "启用" : "停用"%></a>&nbsp;&nbsp;<a href="ExamDownLoadFile.aspx?id=<%# Eval("ID") %>&st=<%= SystemType %>">下载报名表</a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="UpLoadScore(<%# Eval("ID") %>);">上传考试成绩</a>&nbsp;&nbsp;<a href="ExamShowSource.aspx?EID=<%# Eval("ID") %>&st=<%= SystemType %>" target="_blank">查看成绩</a>
					</td>
				</tr>
			</ItemTemplate>
			<AlternatingItemTemplate>
				<tr>
					<td class="form-label">
						<%# Eval("Subject").ToString().CutTo(32, 30)%>
					</td>
					<td class="form-label">
						<%# Convert.ToDateTime(Eval("StartDate")).ToString("yyyy-MM-dd") %>
					</td>
					<td class="form-label">
						<%# Convert.ToDateTime(Eval("EndDate")).ToString("yyyy-MM-dd") %>
					</td>
					<td class="form-label">
						<%# Convert.ToDateTime(Eval("Deadline")).ToString("yyyy-MM-dd") %>
					</td>
					<td class="form-label">
						<%# Convert.ToBoolean( Eval("Status")) ? "<font color='red'>停用</font>":"启用"%>
					</td>
					<td class="form-label">
						<a href="ExamSubjectAdd.aspx?id=<%# Eval("ID") %>&st=<%= SystemType %>" target="_blank">编辑</a>&nbsp;&nbsp;<a id="close" href="javascript:void(0);" onclick="DeleteSubject(<%# Eval("ID") %>)"><%# Convert.ToBoolean(Eval("Status")) ? "启用" : "停用"%></a>&nbsp;&nbsp;<a href="ExamDownLoadFile.aspx?id=<%# Eval("ID") %>&st=<%= SystemType %>">下载报名表
</a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="UpLoadScore(<%# Eval("ID") %>);">上传考试成绩</a>&nbsp;&nbsp;<a href="ExamShowSource.aspx?EID=<%# Eval("ID") %>&st=<%= SystemType %>"
											target="_blank">查看成绩</a>
					</td>
				</tr>
			</AlternatingItemTemplate>
		</asp:Repeater>
		<tr>
			<td colspan="6" class="form-body">
				<a target="_blank" href="ExamSubjectAdd.aspx?st=<%= SystemType %>">新增培训科目</a>
			</td>
			<!--<td class="form-body" >&nbsp;&nbsp;<a href="../../../Template/考试成绩上传表.xls">下载成绩上传表</a></td>-->
		</tr>
		<tr>
			<td colspan="6">
				<uc1:Pager ID="Pager1" runat="server" OnSelectedPageIndexChanged="BindSelectedPageIndexChanged"
					PageSize="15" />
			</td>
		</tr>
	</table>
	<div style="display: none;" id="UploadScore">
		<table>
			<tr>
				<td>
					<asp:FileUpload ID="FileUploadScore" CssClass="inputfile" runat="server" />
				</td>
			</tr>
			<tr>
				<td>
					<asp:HiddenField ID="HidSubjectID" runat="server" Value="0" />
					<span><font color="#FF0000">请上传后缀名为xls的Excel文件</font></span>
					<asp:Button ID="ScoreUpLoadSubbtn" CssClass="btnsearch" runat="server" Text="上传"
						OnClientClick="return Check();" OnClick="ScoreUpLoadSubbtn_Click" />
					<input type="button" class="btnsearch" id="CancelBtn" value="取消" onclick="CancelBtnClick()" />
				</td>
			</tr>
		</table>
	</div>
	<div style="display: none;">
		<asp:HiddenField ID="hid_ID" Value="" runat="server" />
		<asp:Button Text="删除" ID="btn_Delete" runat="server" OnClick="btn_Delete_Click" />
		<asp:Button Text="刷新" ID="btn_NewsRefresh" runat="server" OnClick="btn_NewsRefresh_Click" />
	</div>
</asp:Content>
